home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15471 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: pangea.Stanford.EDU!karish
  2. From: karish@pangea.Stanford.EDU (Chuck Karish)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: extern func() declaration?
  5. Date: 19 Apr 1996 07:01:33 GMT
  6. Organization: Mindcraft, Inc.
  7. Message-ID: <4l7dod$a0k@nntp.Stanford.EDU>
  8. References: <316436C5.413E@micromedia.on.ca> <4l67qu$drk@sun001.spd.dsccc.com>
  9. NNTP-Posting-Host: pangea.stanford.edu
  10.  
  11. In article <4l67qu$drk@sun001.spd.dsccc.com>,
  12. Mike McCarty <jmccarty@sun1307.spd.dsccc.com> wrote:
  13. >In article <316436C5.413E@micromedia.on.ca>,
  14. >Richard Steadman  <rsteadma@micromedia.on.ca> wrote:
  15. >
  16. >)What's the difference between
  17. >)
  18. >)    extern int func(void);
  19. >)
  20. >)and
  21. >)
  22. >)    int func(void);
  23. >)
  24. >)when declaring functions located in another source file?
  25. >
  26. >Pedantic differences aside, they mean -exactly- the same thing.
  27.  
  28. One not-so-pedantic difference is that the declaration with
  29. "extern" also works when the function is actually defined in
  30. the same source module, while the one without is liable to cause
  31. "multiply defined" error messages from the compiler.
  32. --
  33.  
  34.     Chuck Karish          karish@mindcraft.com
  35.     (415) 323-9000 x117   karish@pangea.stanford.edu
  36.